<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>金融资产信息</title>
    <link rel="stylesheet" href="../../js/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.css">

    <script src="../../js/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="../../js/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../js/bower_components/bootbox.min.js"></script>
    <script src="../../js/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
    <script src="../../js/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.js"></script>
    <script src="../../js/bower_components/jquery-form-validator/form-validator/jquery.form-validator.min.js"></script>
    <script src="../../js/bower_components/moment/min/moment-with-locales.min.js"></script>
    <script>
        $(function (){
            initRole();
            inittable();
        })

        function initRole() {
            $("#selCategory1").empty;
            $.ajax({
                type: "post",
                url: "http://121.37.241.58:8883/logic/assets/normal/list",
                dataType: "json",
                success: function (res) {
                    console.log(res);
                    if(!res.flag){
                        $.each(res,function(i,n){
                            $("#selDept").append("<option value=\""+n.dept+"\">"+n.dept+"</option>")
                        });
                        $("#selDept").append("<option value='全部'>全部</option>");
						$("#selDept").selectpicker('refresh');
                    }
                }
            })
        }

        function inittable(){
            $("#tblResult").bootstrapTable("destroy");
            $("#tblResult").bootstrapTable({
                loadMsg: "正在加载数据....",
                url: "",
                sidePagination: 'client',
                pageSize: "5",
                Pageinatin: true,
                idField: "id",
                columns:[{
                    field: "assetscode",
                    title: "资产编码",
                    halign: 'center'
                },{
                    field: "namecn",
                    title: "资产名称",
                    halign: 'center'
                },{field: "normalbrand",
                    title: "品牌",
                    halign: 'center'
                },{field: "normalmodel",
                    title: "型号",
                    halign: 'center'
                },{field: "supplier",
                    title: "供货商",
                    halign: 'center'
                },{
                    field: "kucun",
                    title: "记录",
                    halign: 'center'
                }]
            })
        }
    </script>
</head>
<body>
    <!-- 检索区域 -->
    <div class="container-fluid">
     <div class="row">
         <div id="divSearchForm" class="col-md-10">
             <div>
                 <label for="spanCategoryGroup">托管机构：</label>
                 <span id="spanCategoryGroup">
                     <select id="selCategory1">
                         <option value="-1">全部</option>
                     </select>
                     <select id="selCategory2">
                         <option value="-1">全部</option>
                     </select>
                 </span>
                 <label for="tbxAssetsName">关联账号：</label>
                 <input type="text" id="tbxAssetsName">
                 <label for="tbxAssetsCode">关联账号：</label> 
                 <input type="text" id="tbxAssetsCode" />
             </div>
             <div>
                 <label for="selPackageType">金融资产类别：</label> 
                     <select id="selPackageType">
                         <option value="-1"> 全 部</option>
                     </select>
 
                 <label for="tbxSupplier">供货商信息：</label> 
                 <input type="text" id="tbxSupplier" />
 
                 <label for="cbkConsumptive">是否自动续期：</label> 
                 <input type="checkbox" id="cbkConsumptive"/>

                 
                 
                 <button type="button" id="btnSearch" class="btn-primary"> 
                     <span class="glyphicon glyphicon-search">检索 Search</span>
                 </button>
             </div> 
             <div>
                <label for="tbxSupplier">最低购置金额：</label> 
                 <input type="text" id="tbxSupplier" />

                 <label for="tbxSupplier">购买周期：</label> 
                 <input type="text" id="tbxSupplier" />
             </div>
         </div>
     </div>
     <!-- 功能区域 -->
     <div class="row"> 
         <div class="col-md-10"> 
             <div id="toolsButtons">
                 <button type="button" id="btnAdd" class="btn-success">
                     <span class="glyphicon glyphicon-plus">新增资产 Add</span>
                 </button>
                 <button type="button" id="btnInstockShow" class="btn-primary"> 
                     <span class="glyphicon glyphicon-download-alt">资产入库 Instock</span>
                 </button>
                 <button type="button" id="btnEdit" class="btn-warning"> 
                     <span class="glyphicon glyphicon-edit">编辑资产 Edit </span>
                 </button> 
             </div>
         </div>
     </div>
     <!-- 列表区域 -->
     <div class="row col-md-10">
         <table id="tblResult"></table>
     </div>
 </div>
 </body>
 </html>